The present invention relates to a content-addressed memory. More particularly, the present invention pertains to a technique which may be utilized effectively in an associative memory constituted by, for example, a one-chip semiconductor integrated circuit.
The content-addressed memory, which is one type of associative memory, is adapted to effect the following associative operation. Input data, which consists of a plurality of bits, includes a data code (key) constituted by a part of the input data, that is, any desired several bits therein. This input data is input after it has been made invalid (masked) except for the key portion. The input key is compared with bits (keys of stored data) corresponding to input keys of all the data stored in the associative memory. As a result, stored data which has the same key as the input key is output as data associated with the input data (see, e.g., the Oct. 27, 1980, issue of "Nikkei Electronics", Nikkei-McGraw-Hill, pp. 103 to 135).
The content-addressed memory greatly differs from ordinary memories in that stored data items are accessed by their contents (keys) rather than their specific addresses in memory. More specifically, the content-addressed memory operates such that an input key is logically compared with each of the stored data, and a flag (a hit flag) is set on stored data which satisfies particular associative conditions. In an associative memory, a static RAM in which there has been stored the data associated with the input data is automatically selected by the above-described hit flag, and the associated data is thereby output.
Thus, management of keys is very important in the use of an associative memory provided with a content-addressed memory. More specifically, if a plurality of data items respectively including keys with the same bit pattern are stored in an associative memory, multiple selection of memory locations may occur, that is, two or more memory locations may be undesirably selected at the same time. This must be taken into full consideration, particularly, when a specific bit in a key is masked. When a single associative memory is used for execution of a plurality of programs, if a key which has been used for a previous program is left in the content-addressed memory, there is a possibility of two or more keys having the same bit pattern being provided as in the case described above. If such multiple keys are stored in the content-addressed memory, multiple selection of storage locations may undesirably take place, resulting in destruction of data stored in the memory. Accordingly, it is necessary to effect processing, such as clearing of the contents of the content-addressed memory, before the program is executed.
As described above, management of keys is extremely troublesome in the operation of an associative memory wherein data corresponding to one key is taken out using a content-addressed memory.